package day02;

/**
 * Created by Administrator on 2023/6/30 0030.
 */
public class FunctionPassByValue {
    public static void main(String[] args) {
        int a = 3, b = 4;
        int[] c = {1, 2, 3, 4};
        swap(a, b);
        swap(c, 0, 1);
        System.out.println(a + " " + b);
    }

    private static void swap(int[] c, int i, int j) {
        int t = c[i];
        c[i] = c[j];
        c[j] = t;
    }

    private static void swap(int a, int b) {
        int t = a;
        a = b;
        b = t;
    }
}
